{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0101a9b9-368c-4aad-a20f-bcd05a738bd8",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "017c5086-e92a-46b7-840a-fe696748fc3a",
   "metadata": {},
   "source": [
    "## 数据清洗\n",
    "\n",
    "### DataFrame如何处理重复数据?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "2e27aa06-38f9-4221-87ff-cec11acb2ade",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fruit</th>\n",
       "      <th>price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>apple</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>orange</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>banana</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    fruit  price\n",
       "0   apple     10\n",
       "1  banana     20\n",
       "2   apple     15\n",
       "3  orange     30\n",
       "4  banana     25"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "1    False\n",
       "2     True\n",
       "3    False\n",
       "4     True\n",
       "dtype: bool"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = {'fruit': ['apple', 'banana', 'apple', 'orange', 'banana'],\n",
    "        'price': [10, 20, 15, 30, 25]}\n",
    "df = pd.DataFrame(data)\n",
    "display(df)\n",
    "display(df.duplicated(subset=['fruit']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "59e245e6-0908-4ad0-b0ab-2d50cb7b1f7f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fruit</th>\n",
       "      <th>price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>orange</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    fruit  price\n",
       "0   apple     10\n",
       "1  banana     20\n",
       "3  orange     30"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 默认保留第一个出现的重复行\n",
    "df_no_duplicates = df.drop_duplicates(subset=['fruit'])\n",
    "display(df_no_duplicates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4a442310-51e7-4036-87e5-d5614de0058a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fruit</th>\n",
       "      <th>price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>apple</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>orange</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>banana</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    fruit  price\n",
       "0   apple     10\n",
       "1  banana     20\n",
       "2   apple     15\n",
       "3  orange     30\n",
       "4  banana     25"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fruit</th>\n",
       "      <th>price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>orange</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    fruit  price\n",
       "0   apple     10\n",
       "1  banana     20\n",
       "3  orange     30"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_no_duplicates_last = df.drop_duplicates(subset=['fruit'], keep='last')\n",
    "display(df_no_duplicates)\n",
    "# display(pd.__version__)\n",
    "# not work"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d162c955-bfa9-45ef-a29f-1bf8a04f5b46",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fruit</th>\n",
       "      <th>price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>orange</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    fruit  price\n",
       "0   apple     10\n",
       "1  banana     20\n",
       "3  orange     30"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_no_duplicates_last = df.drop_duplicates(subset=['fruit'], keep=False)\n",
    "display(df_no_duplicates)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "95960f9f-4c39-4744-837b-cb5fdce33d7b",
   "metadata": {},
   "source": [
    "### Pandas如何删除空数据?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "93203f92-cf04-456e-bf00-073d3e24e519",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>7.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B   C\n",
       "0  1.0  5.0   9\n",
       "1  2.0  NaN  10\n",
       "2  NaN  7.0  11\n",
       "3  4.0  8.0  12"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B   C\n",
       "0  1.0  5.0   9\n",
       "3  4.0  8.0  12"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    C\n",
       "0   9\n",
       "1  10\n",
       "2  11\n",
       "3  12"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>7.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B   C\n",
       "0  1.0  5.0   9\n",
       "1  2.0  NaN  10\n",
       "2  NaN  7.0  11\n",
       "3  4.0  8.0  12"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>7.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B   C\n",
       "0  1.0  5.0   9\n",
       "1  2.0  NaN  10\n",
       "2  NaN  7.0  11\n",
       "3  4.0  8.0  12"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = {\n",
    "    'A': [1, 2, np.nan, 4],\n",
    "    'B': [5, np.nan, 7, 8],\n",
    "    'C': [9, 10, 11, 12]\n",
    "}\n",
    "df = pd.DataFrame(data)\n",
    "display(df)\n",
    "\n",
    "display(df.dropna())\n",
    "\n",
    "display(df.dropna(axis=1))\n",
    "\n",
    "display(df.dropna(how='all'))\n",
    "\n",
    "display(df.dropna(axis=1, how='all'))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5271ed16-fea5-402f-998b-fe8ccf7aeda5",
   "metadata": {},
   "source": [
    "### Pandas如何填充空数据?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7b0abea0-759e-43a7-b58b-2a9e4346d5e9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Python</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>54</td>\n",
       "      <td>141.0</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>82</td>\n",
       "      <td>NaN</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>122</td>\n",
       "      <td>51.0</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>148</td>\n",
       "      <td>147.0</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>49</td>\n",
       "      <td>NaN</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>127</td>\n",
       "      <td>NaN</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>120</td>\n",
       "      <td>NaN</td>\n",
       "      <td>134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>126</td>\n",
       "      <td>51.0</td>\n",
       "      <td>105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>92</td>\n",
       "      <td>40.0</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>34</td>\n",
       "      <td>NaN</td>\n",
       "      <td>146</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Python   Math  English\n",
       "0      54  141.0       97\n",
       "1      82    NaN       37\n",
       "2     122   51.0       79\n",
       "3     148  147.0       77\n",
       "4      49    NaN       42\n",
       "5     127    NaN      108\n",
       "6     120    NaN      134\n",
       "7     126   51.0      105\n",
       "8      92   40.0       90\n",
       "9      34    NaN      146"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.randint(0, 151, size=(10, 3)), columns=['Python', 'Math', 'English'])\n",
    "df[df < 30] = np.nan\n",
    "display(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b1c11416-dd0b-4840-9a41-60530cc4443f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Python</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>54</td>\n",
       "      <td>141.0</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>82</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>122</td>\n",
       "      <td>51.0</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>148</td>\n",
       "      <td>147.0</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>49</td>\n",
       "      <td>0.0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>127</td>\n",
       "      <td>0.0</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>120</td>\n",
       "      <td>0.0</td>\n",
       "      <td>134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>126</td>\n",
       "      <td>51.0</td>\n",
       "      <td>105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>92</td>\n",
       "      <td>40.0</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>34</td>\n",
       "      <td>0.0</td>\n",
       "      <td>146</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Python   Math  English\n",
       "0      54  141.0       97\n",
       "1      82    0.0       37\n",
       "2     122   51.0       79\n",
       "3     148  147.0       77\n",
       "4      49    0.0       42\n",
       "5     127    0.0      108\n",
       "6     120    0.0      134\n",
       "7     126   51.0      105\n",
       "8      92   40.0       90\n",
       "9      34    0.0      146"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.fillna(value=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "64672aec-05c0-42bd-8596-cdc07f0fd267",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Python</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>54</td>\n",
       "      <td>141.0</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>82</td>\n",
       "      <td>86.0</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>122</td>\n",
       "      <td>51.0</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>148</td>\n",
       "      <td>147.0</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>49</td>\n",
       "      <td>86.0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>127</td>\n",
       "      <td>86.0</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>120</td>\n",
       "      <td>86.0</td>\n",
       "      <td>134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>126</td>\n",
       "      <td>51.0</td>\n",
       "      <td>105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>92</td>\n",
       "      <td>40.0</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>34</td>\n",
       "      <td>86.0</td>\n",
       "      <td>146</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Python   Math  English\n",
       "0      54  141.0       97\n",
       "1      82   86.0       37\n",
       "2     122   51.0       79\n",
       "3     148  147.0       77\n",
       "4      49   86.0       42\n",
       "5     127   86.0      108\n",
       "6     120   86.0      134\n",
       "7     126   51.0      105\n",
       "8      92   40.0       90\n",
       "9      34   86.0      146"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.fillna(df.mean().round(1))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b6e541c9-c64a-4248-9f91-5365d6af8841",
   "metadata": {},
   "source": [
    "### Pandas如何处理异常数据?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e07a0124-291e-4a3c-8d2c-949ee6f9ef4d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "299    300\n",
       "dtype: int64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "Index([299], dtype='int64')"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = pd.Series(np.random.randint(0, 100, size=300))\n",
    "data.iloc[-1]=300\n",
    "\n",
    "mean = data.mean()\n",
    "std = data.std()\n",
    "\n",
    "upper_limit = mean + 3 * std\n",
    "lower_limit = mean - 3 * std\n",
    "\n",
    "cond = (data > upper_limit) | (data < lower_limit)\n",
    "display(data[cond])\n",
    "display(data[cond].index)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0b6b6bcb-b948-4c61-95a4-5a40502db9d4",
   "metadata": {},
   "source": [
    "### Pandas如何删除异常值?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "43a2ff71-5f33-49bf-a2ab-6556d3717d35",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      92\n",
       "1      98\n",
       "2      26\n",
       "3      32\n",
       "4      13\n",
       "       ..\n",
       "294    44\n",
       "295    71\n",
       "296    42\n",
       "297    89\n",
       "298    54\n",
       "Length: 299, dtype: int64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(data[~cond])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "adf05855-8c38-4aa6-b6cb-54a852ea874b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      81\n",
       "1      68\n",
       "2      34\n",
       "3      46\n",
       "4       8\n",
       "       ..\n",
       "294    72\n",
       "295    81\n",
       "296     4\n",
       "297    59\n",
       "298    23\n",
       "Length: 299, dtype: int64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data.drop(data[cond].index, inplace=True)\n",
    "display(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7d2cce52-4e04-45ce-b982-89d212e2028d",
   "metadata": {},
   "source": [
    "### 箱线图如何处理异常值?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f2acf137-6e04-430c-a5e2-93bf8bd8fd04",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting matplotlib\n",
      "  Downloading matplotlib-3.10.1-cp312-cp312-macosx_10_13_x86_64.whl.metadata (11 kB)\n",
      "Collecting contourpy>=1.0.1 (from matplotlib)\n",
      "  Downloading contourpy-1.3.2-cp312-cp312-macosx_10_13_x86_64.whl.metadata (5.5 kB)\n",
      "Collecting cycler>=0.10 (from matplotlib)\n",
      "  Downloading cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)\n",
      "Collecting fonttools>=4.22.0 (from matplotlib)\n",
      "  Downloading fonttools-4.57.0-cp312-cp312-macosx_10_13_x86_64.whl.metadata (102 kB)\n",
      "Collecting kiwisolver>=1.3.1 (from matplotlib)\n",
      "  Downloading kiwisolver-1.4.8-cp312-cp312-macosx_10_13_x86_64.whl.metadata (6.2 kB)\n",
      "Requirement already satisfied: numpy>=1.23 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from matplotlib) (2.2.4)\n",
      "Requirement already satisfied: packaging>=20.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from matplotlib) (24.1)\n",
      "Collecting pillow>=8 (from matplotlib)\n",
      "  Downloading pillow-11.2.1-cp312-cp312-macosx_10_13_x86_64.whl.metadata (8.9 kB)\n",
      "Collecting pyparsing>=2.3.1 (from matplotlib)\n",
      "  Downloading pyparsing-3.2.3-py3-none-any.whl.metadata (5.0 kB)\n",
      "Requirement already satisfied: python-dateutil>=2.7 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from matplotlib) (2.9.0.post0)\n",
      "Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n",
      "Downloading matplotlib-3.10.1-cp312-cp312-macosx_10_13_x86_64.whl (8.2 MB)\n",
      "\u001b[2K   \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.2/8.2 MB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m:01\u001b[0m\n",
      "\u001b[?25hDownloading contourpy-1.3.2-cp312-cp312-macosx_10_13_x86_64.whl (271 kB)\n",
      "Downloading cycler-0.12.1-py3-none-any.whl (8.3 kB)\n",
      "Downloading fonttools-4.57.0-cp312-cp312-macosx_10_13_x86_64.whl (2.3 MB)\n",
      "\u001b[2K   \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hDownloading kiwisolver-1.4.8-cp312-cp312-macosx_10_13_x86_64.whl (66 kB)\n",
      "Downloading pillow-11.2.1-cp312-cp312-macosx_10_13_x86_64.whl (3.2 MB)\n",
      "\u001b[2K   \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.2/3.2 MB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hDownloading pyparsing-3.2.3-py3-none-any.whl (111 kB)\n",
      "Installing collected packages: pyparsing, pillow, kiwisolver, fonttools, cycler, contourpy, matplotlib\n",
      "Successfully installed contourpy-1.3.2 cycler-0.12.1 fonttools-4.57.0 kiwisolver-1.4.8 matplotlib-3.10.1 pillow-11.2.1 pyparsing-3.2.3\n",
      "\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.0.1\u001b[0m\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "pip install matplotlib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c0053f62-a535-4574-8c43-0eaf29d6a207",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Matplotlib is building the font cache; this may take a moment.\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "3fd7711e-f889-4b9e-bf21-27b39e6370bf",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjEsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvc2/+5QAAAAlwSFlzAAAPYQAAD2EBqD+naQAAH8BJREFUeJzt3XtQVPf9//EXyLpycRchBiSCYWIiJCGJ0kQ3GhsNl0J/jhZMGmNbkzjtHyW2ivZCJ5cydSRNoqZpYlIziX7bie1vNGqj8QKlisaKVVoy2hqi1lRThFxhBWQ94v7+8Ov+QiUJC+tnl/X5mHGc/ezh7BtmDvucs2fZCK/X6xUAAIAhkcEeAAAAXFmIDwAAYBTxAQAAjCI+AACAUcQHA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dfXKysrS2fPnu1xX5GRF37dfPYlEsuyum3T1tamadOmqb6+vtu/I0eOaPLkyRo0aJCqqqq0detW3Xjjjfr1r3+tMWPG6Pjx45fpJwDgcuBlFwCfa8iQISoqKtJrr72mo0ePasyYMRo3bpwkac+ePXrwwQf1jW98Q9KFcHjvvfc+d1/Dhw+XdOG6jbFjx0pSt4tPJWncuHF6/fXXde211yoqqudfTxEREZo4caImTpyoxx9/XKNGjdKGDRtUWlraz+8WgCmc+QDwhWbPnq0333xTr776qu+shyRdf/31Wr9+verr6/X222/rgQceuOSdMZ8VHR2tCRMm6Mknn9Thw4dVU1OjRx99tNs2JSUl+uSTTzRr1izt379fx44d0/bt2/XQQw+pq6tL+/bt05IlS3TgwAGdOHFC69ev14cffqjMzMzL9v0DCDziA8AXmjp1qhISEtTQ0KAHHnjAt75s2TINGzZMd955p6ZNm6b8/HzfWZHP8+qrr+rcuXPKzs7W/PnztXjx4m73p6SkaM+ePerq6lJeXp6ysrI0f/58xcfHKzIyUg6HQ7t27VJhYaFuuOEGPfroo1q6dKkKCgouy/cO4PKI8PIeNQAAYBBnPgAAgFHEBwAAMIr4AAAARhEfAADAKOIDAAAYRXwAAACjiA8AAGAU8QEAAIwiPgAAgFHEBwAAMIr4AAAARhEfAADAqP8HiMZsSX+0f48AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = pd.DataFrame({'values': [10, 12, 14, 16, 18, 20, 22, 24, 26, 60]})\n",
    "\n",
    "# 1. 绘制箱线图\n",
    "data.boxplot(column='values')\n",
    "\n",
    "# 显示箱线图\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "66ab59e1-aa85-4b81-a08e-d9a1b6cf5fad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAAGfCAYAAACneiONAAAAOnRF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AAQ/kdapqampSQkKA1a9a02V5bW+vz2rhxoywWiyZPnnzBee+66y6fcR988IFP+3/+53/q97//vbZv3669e/fqiy++0KRJk/xdPgAAMFQXfwc4HA45HI522yMjI33Kb7/9thITE3XbbbddeCFdurQae15jY6M2bNigrVu3asyYMZKk119/XXfeeaf279+v4cOH+3kUAADANH6HGn/U19frnXfe0aZNmy7a98SJE7Lb7eratatGjBih3NxcxcbGSpI+/PBDud1uJSUlefv3799fsbGxKisrazPUtLS0qKWlxVt2Op2SJLfbLbfbfbmHBuAacv6c5twGzOPPeX1FQ82mTZvUo0ePi14mGjZsmPLy8tSvXz/V1tYqJydHDzzwgI4cOaIePXqorq5ON910k26++WafcREREaqrq2tzztzcXOXk5LSqLyoqUnBw8CUfE4BrV3Fx8dVeAoBO1tzc3OG+VzTUbNy4UdOmTVPXrl0v2O+fL2cNGjRIw4YNU1xcnP77v/9bM2fOvKT3zs7OVlZWlrfsdDoVExOj5ORkhYSEXNKcAK5NbrdbxcXFGjdunKxW69VeDoBOdP5KS0dcsVDz/vvv69ixY/rd737n99ibb75ZP/nJT1RZWSnp+/t0zp49q4aGBp/dmvr6+nbvw7HZbLLZbN6yx+ORJJ05c4YPPcAwbrdbzc3NOnPmjL799turvRwAnejMmTOS/vd7/EKuWKjZsGGDhg4dqoSEBL/HulwuVVVV6ec//7kkaejQobJardqzZ4/3V1THjh1TTU2NRowY0aE5v/76a0lSTEyM3+sBAABX19dff63Q0NAL9vE71LhcLu8OiiRVV1eroqJCYWFh3ht7nU6ntm/frpdeeqnNOcaOHauf/vSnmjNnjiTpqaeeUlpamuLi4vTFF1/o2WefVWBgoKZOnSpJCg0N1cyZM5WVlaWwsDCFhIToP/7jPzRixIgO//LJbrfr888/V48ePWSxWPw9bADXsPOXlz///HMuLwOG8Xg8+vrrr2W32y/a1+9QU15ersTERG/5/H0rmZmZysvLkyRt27ZNHo/HG0p+qKqqSl9++aW3fPLkSU2dOlWnTp1SeHi47r//fu3fv1/h4eHePqtWrVJAQIAmT56slpYWpaSk6L/+6786vO6AgABFR0f7c6gArjMhISGEGsBAF9uhOc/i6chFKgC4hjmdToWGhqqxsZFQA9zA+NtPAADACIQaANc9m82mZ5991ucXjwBuPFx+AgAARmCnBgAAGIFQAwAAjECoAQAARiDUAAAAIxBqAFx3+vTpo5dffvlqLwPANYZQAwAAjECoAQAARiDUAPhRvfbaa7Lb7Tp37pxP/cSJEzVjxgxVVVVp4sSJioiIUPfu3fUv//Iv2r17d7vzffrpp7JYLKqoqPDWNTQ0yGKxqKSkxFt35MgRORwOde/eXREREfr5z3/u8zfo/ud//kcDBw5UUFCQbrnlFiUlJampqanTjhvAlUeoAfCjevjhh3Xq1Cm999573rrTp09r165dmjZtmlwul8aPH689e/bo0KFDSk1NVVpammpqai75PRsaGjRmzBgNGTJE5eXl2rVrl+rr6/Wv//qvkqTa2lpNnTpVM2bM0NGjR1VSUqJJkyaJZ5MC1xe//0o3AFyOnj17yuFwaOvWrRo7dqyk73dJevXqpcTERAUEBCghIcHbf/HixcrPz1dhYaHmzJlzSe/5m9/8RkOGDNHSpUu9dRs3blRMTIyOHz8ul8ulb7/9VpMmTVJcXJwkaeDAgZdxlACuBnZqAPzopk2bprfeekstLS2SpDfeeENTpkxRQECAXC6XnnrqKd155526+eab1b17dx09evSydmo++ugjvffee+revbv31b9/f0lSVVWVEhISNHbsWA0cOFAPP/yw1q9fr6+++qpTjhXAj4dQA+BHl5aWJo/Ho3feeUeff/653n//fU2bNk2S9NRTTyk/P19Lly7V+++/r4qKCg0cOFBnz55tc66AgO8/xv75UpHb7fbp43K5lJaWpoqKCp/XiRMnNGrUKAUGBqq4uFjvvvuuBgwYoNWrV6tfv36qrq6+Qv8DAK4ELj8B+NF17dpVkyZN0htvvKHKykr169dP99xzjyTpz3/+s6ZPn66f/vSnkr4PJJ9++mm7c4WHh0v6/r6YIUOGSJLPTcOSdM899+itt95Snz591KVL2x97FotF9913n+677z4tWrRIcXFxys/PV1ZW1mUeLYAfCzs1AK6KadOm6Z133tHGjRu9uzSS1LdvX+3YsUMVFRX66KOP9Oijj7b6pdQ/CwoK0vDhw7Vs2TIdPXpUe/fu1YIFC3z6zJ49W6dPn9bUqVP1l7/8RVVVVfrjH/+oX/ziF/ruu+904MABLV26VOXl5aqpqdGOHTv0j3/8Q3feeecVO34AnY9QA+CqGDNmjMLCwnTs2DE9+uij3vqVK1eqZ8+eGjlypNLS0pSSkuLdxWnPxo0b9e2332ro0KGaO3eulixZ4tNut9v15z//Wd99952Sk5M1cOBAzZ07VzfffLMCAgIUEhKi0tJSjR8/Xj/5yU+0YMECvfTSS3I4HFfk2AFcGRYPv1kEAAAGYKcGAAAYgVADAACMQKgBAABGINQAAAAjEGoAAIARCDUAAMAIhBoAAGAEQg0AADACoQYAABiBUAMAAIxAqAEAAEb4/wW93pYsrLyXAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 2. 查找异常值\n",
    "q1 = data['values'].quantile(0.25)\n",
    "q3 = data['values'].quantile(0.75)\n",
    "iqr = q3 - q1\n",
    "upper_bound = q1 + 1.5 * iqr\n",
    "lower_bound = q3 - 1.5 * iqr\n",
    "cond = (data['values'] > upper_bound) | (data['values'] < lower_bound)\n",
    "\n",
    "# 3. 处理异常值\n",
    "data['values'][cond] = data['values'].median()\n",
    "\n",
    "data.boxplot(column='values')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "88990298-5a38-47fd-88f0-8e32c6c6b34d",
   "metadata": {},
   "source": [
    "### 通过插值法处理异常值?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "467b8ee3-793a-49f5-96d0-a1758879f9c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>values</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>14.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>22.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>26.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>32.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>36.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>38.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    values\n",
       "0     10.0\n",
       "1     12.0\n",
       "2     14.0\n",
       "3     16.0\n",
       "4     18.0\n",
       "5     20.0\n",
       "6     22.0\n",
       "7     24.0\n",
       "8     26.0\n",
       "9      NaN\n",
       "10     NaN\n",
       "11    32.0\n",
       "12    36.0\n",
       "13    38.0"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = pd.DataFrame({'values': [10, 12, 14, 16, 18, 20, 22, 24, 26, 60, 100, 32, 36, 38]})\n",
    "\n",
    "q1 = data['values'].quantile(0.25)\n",
    "q3 = data['values'].quantile(0.75)\n",
    "iqr = q3 - q1\n",
    "upper_bound = q1 + 1.5 * iqr\n",
    "lower_bound = q3 - 1.5 * iqr\n",
    "cond = (data['values'] > upper_bound) | (data['values'] < lower_bound)\n",
    "\n",
    "# data['values'][cond] = np.nan\n",
    "data.loc[cond, 'values'] = np.nan\n",
    "display(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "fe7079ac-a7f5-4e5b-98c7-11f23d6459dc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>values</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>14.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>22.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>26.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>28.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>32.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>36.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>38.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    values\n",
       "0     10.0\n",
       "1     12.0\n",
       "2     14.0\n",
       "3     16.0\n",
       "4     18.0\n",
       "5     20.0\n",
       "6     22.0\n",
       "7     24.0\n",
       "8     26.0\n",
       "9     28.0\n",
       "10    30.0\n",
       "11    32.0\n",
       "12    36.0\n",
       "13    38.0"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data['values'] = data['values'].interpolate()\n",
    "display(data)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
